package com.itheima.user.controller;

import com.itheima.common.response.UserOrderVo;
import com.itheima.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @作者 itcast
 * @创建日期 2020/10/17 15:23
 **/
@RestController
@RequestMapping("user")
@RefreshScope
public class UserController {
    @Value("${test}")
    String test;

    @Autowired
    UserService userService;
    @GetMapping("{username}")
    public UserOrderVo findUserByUserId(@PathVariable("username") String username ){
        System.out.println(test);
        return userService.findUserById(username);
    }
}
